import React, { Component } from 'react';
import {  Flex, WingBlank,WhiteSpace,Icon } from 'antd-mobile';
import { Link, routerRedux } from 'dva/router';
import { connect } from 'dva';
import { necessaryTools } from './necessaryTools.less';
import toolssvg from "../../assets/img/tools.svg";
import fapiaosvg from "../../assets/img/fapiao.svg";
import kefusvg from "../../assets/img/kefu2.svg";
import huiyuansvg from "../../assets/img/huiyuan2.svg";
import quanzisvg from "../../assets/img/quanzi.svg";

class NecessaryTools extends Component {


    render() {
        const { data } = this.props;
        return (
            <div className={necessaryTools}>
                <WingBlank>
                    <WhiteSpace size="sm"/>
                    <Flex justify="between" style={{borderBottom:"1px solid #e5e5e5",padding:".2rem 0"}}>
                        <Flex>
                            <Icon className="tools_logo" type={toolssvg.id}/>
                            <div>其他</div>
                        </Flex>
                        {/*<Flex>*/}
                            {/*<div className="all_tools">查看全部</div>*/}
                            {/*<Icon type={rightsvg.id} style={{width:".3rem",height:".3rem",marginLeft:".05rem"}}/>*/}
                        {/*</Flex>*/}
                    </Flex>
                    <Flex justify="around" className="tools">
                        <div onClick={()=>{
                            if(this.props.token!=null){
                            this.props.dispatch(routerRedux.push({
                                pathname:`/myInvoice`
                            }))}
                        }}>
                            <Flex justify="center">
                                <Icon className="fapiao" type={fapiaosvg.id}/>
                            </Flex>
                            <div style={{textAlign:"center"}}>我的发票</div>
                        </div>
                        {/* <div>
                            <Flex justify="center">
                                <Icon className="fapiao" type={kefusvg.id}></Icon>
                            </Flex>
                            <div>客服中心</div>
                        </div> */}
                        {/*<div onClick={()=>{*/}
                            {/*this.props.dispatch(routerRedux.push({*/}
                                {/*pathname:`/memberCenter`*/}
                            {/*}))*/}
                        {/*}}>*/}
                            {/*<Flex justify="center">*/}
                                {/*<Icon className="fapiao" type={huiyuansvg.id}></Icon>*/}
                            {/*</Flex>*/}
                            {/*<div>店铺会员</div>*/}
                        {/*</div>*/}
                        {/* <div>
                            <Flex justify="center">
                                <Icon className="fapiao" type={quanzisvg.id}></Icon>
                            </Flex>
                            <div>圈&nbsp;子</div>
                        </div> */}
                    </Flex>
                    <WhiteSpace size="sm"/>
                </WingBlank>
            </div>
        );
    }
}


export default connect(({ My }) => ({ My }))(NecessaryTools);
